document.getElementById('readDecision').addEventListener('change',function(){
    readFile(this,function(data){
        console.log(data); 
        // document.getElementById('production').innerHTML= 1000;
    },function(){
        alert('解析文件出错');
    })
});
function readFile(input,sc,ec) {
    //支持chrome IE10
    if (window.FileReader) {
        var file = input.files[0];
        filename = file.name.split(".")[0];
        var reader = new FileReader();
        reader.onload = function() {
            sc(this.result); //这里的 this 指向 FileReader 
        };
        reader.readAsText(file);
    }
    //支持IE 7 8 9 10
    else if (typeof window.ActiveXObject != 'undefined'){
        var xmlDoc;
        xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.async = false;
        xmlDoc.load(input.value);
        sc(xmlDoc);
    }
    //支持FF
    else if (document.implementation && document.implementation.createDocument) {
        var xmlDoc;
        xmlDoc = document.implementation.createDocument("", "", null);
        xmlDoc.async = false;
        xmlDoc.load(input.value);
        sc(xmlDoc);
    } else {
        ec();
    }
}

